﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Contact : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnBook_Click(object sender, EventArgs e)
    {
        string url = string.Empty;
        try
        {
            //string _mailServer = "smtp.gmail.com";
            //int _mailPort = 587;
            //string _pass = "trung1951990";
            //string _mailFrom = "trinhhongtrung@gmail.com";
            //string body = "Customner Infomation: <br/> Full name: " + ddlTitle.SelectedItem + " " + txtFullName.Text
            //    + "<br/>Country: " + ddlCountry.SelectedItem + "<br/>Hotel Address: " + txtAddress.Text
            //    + "<br/>Room number : " + txtRoom.Text + "<br/>Email:" + txtEmail.Text + "<br/>Tour Infomation:<br/>Tour Name: " + lblTourName.Text + "<br/>Departure date: " + datepicker.Text + "<br/>Adults: " + txtAdults.Text
            //     + "<br/>Children under 12 years old: " + txtChild.Text + "<br/>Other requirement: " + areRequire.Value;

            ////string body = "";
            //MailMessage mailMessage = new MailMessage();
            //SmtpClient mailClient = new SmtpClient(_mailServer, _mailPort);
            //mailClient.Timeout = 15000;
            //mailClient.Credentials = new NetworkCredential(_mailFrom, _pass);
            //mailClient.EnableSsl = true;
            //mailMessage.IsBodyHtml = true;
            //mailMessage.From = new MailAddress(_mailFrom);
            //mailMessage.Subject = "Booking Tour";
            //mailMessage.Body = body;

            //mailMessage.To.Add(txtEmail.Text);
            //mailMessage.To.Add(_mailFrom);
            ////mailClient.Send(mailMessage);
            ////att.Dispose();
            //mailMessage.Dispose();
            //url = "Info.aspx";
            //ScriptManager.RegisterStartupScript(this, this.Page.GetType(), "Error", "alert('Successful booking.')", true);
        }
        catch (Exception ex)
        {

        }
        if (url.Length > 0)
        {
            Response.Redirect(url);
        }
    }

    protected void btnReset_Click(object sender, EventArgs e)
    {
        //txtAddress.Text = "";
        //txtAdults.Text = "";
        //txtChild.Text = "";
        //txtEmail.Text = "";
        //txtFullName.Text = "";
        //txtRoom.Text = "";
        //ddlTitle.SelectedIndex = 0;
        //ddlCountry.SelectedIndex = 0;
    }
}